#ifndef YS_FORM_PATIENT_DETAIL_H
#define YS_FORM_PATIENT_DETAIL_H

#include "pub_pop_get_date.h"
#include "pub_pop_delay.h"

#include <QWidget>
#include <QJsonObject>
#include <QJsonArray>
#include <QSqlQuery>
#include <QMap>
#include <QSqlQueryModel>
#include <QElapsedTimer>

namespace Ui {
class ys_form_patient_detail;
}

class ys_form_patient_detail : public QWidget
{
    Q_OBJECT

public:
    explicit ys_form_patient_detail(QWidget *parent = nullptr);
    ~ys_form_patient_detail();
    void closeEvent(QCloseEvent *event);

signals:
    void destroyW( QString );
private slots:
    void on_tb_reg_0_clicked();

    void on_tb_reg_1_clicked();

    void on_cbb_dept_currentTextChanged(const QString &arg1);

    void on_pb_exit_clicked();

    void on_pb_list_patient_clicked();

    void on_tv_list_patient_clicked(const QModelIndex &index);

    void on_tv_list_patient_doubleClicked(const QModelIndex &index);

    void on_pb_export_clicked();

    void on_pb_clear_clicked();

    void on_tv_patient_detail_doubleClicked(const QModelIndex &index);

    void on_tv_rec_hist_doubleClicked(const QModelIndex &index);

    void on_tv_rec_hist_clicked(const QModelIndex &index);

    void on_pb_rec_check_clicked();

    void on_tabWidget_currentChanged(int index);

private:
    Ui::ys_form_patient_detail *ui;

    pub_pop_get_date * dlg_get_date;
    Pub_pop_delay * dlgDelay;

    QSqlQuery *qrm, *qrmt, *qro, *qrot;
    //QSqlQueryModel mdList ;//
    QString sq;
    QSqlQueryModel *md_list_patient, *md_patient_detail, *md_rec_hist;

    QString doct_code, dept_code ;

    bool initial_finished;

    QElapsedTimer time_elapse;

    QString display_id; //当前正在展示明细的id ,  idenno + card_no
    //QString display_iden; //当前正在展示明细的身份证号

};

#endif // YS_FORM_PATIENT_DETAIL_H
